package com.example.tests;

import java.util.ArrayList;
import java.util.List;

import org.testng.Assert;
import org.testng.annotations.Test;

import com.example.data.ContactData;


public class PrintPhonesTest  extends TestBase {
	@Test
	public void printPhonesTest() throws Exception {
		//get size of list of contacts at main page
		
		ArrayList<ContactData> contactsList =  new ArrayList<ContactData>(manager.getContactHelper().getArrayContactsList()); 
		int contactsListSize = contactsList.size();
		//get size of table at PrintPhonesPage
		int numberOfConcontactsAtPrintPhonesPage = manager.getContactHelper().getNumberOfContactsAtPrintPhonesPage();
		//compare numbers
		Assert.assertEquals(numberOfConcontactsAtPrintPhonesPage, contactsListSize);
		//check the order of entries at both pages is the same
		//check that first name, last name, email and telephone are the same at both pages
		//compare 2 arraylists
		List<ContactData> listAtPrintPhonesPage = manager.getContactHelper().getListOfContactsAtPrintPhonesPage();
		Assert.assertEquals(listAtPrintPhonesPage, contactsList);
	}
}
